﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AnyGrid.Renderers;
using System.Collections.ObjectModel;

namespace AnyGrid.Metadata
{
    public class ColumnOptionCollection : Collection<GridCustomOption>
    {
        public IEnumerable<object> Values(string optionName, GridKind forGridKind)
        {
            return from o in this
                   where o.OptionName.Equals(optionName, StringComparison.OrdinalIgnoreCase)
                        && (o.ForGridKind == GridKind.AllGrids || o.ForGridKind == forGridKind)
                   select o.OptionValue;
        }

        public ColumnOptionCollection() : base() { }
        public ColumnOptionCollection(IList<GridCustomOption> options) : base(options) { }
    }
}
